package com.cloudfast.platform.dict.entity;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import com.cloudfast.entity.BaseEntity;
import com.cloudfast.repository.annotation.DeleteField;
import com.fasterxml.jackson.annotation.JsonFormat;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

/**
 * @author liuyw
 * @描述:字典
 * @date 2020年4月30日
 */
@SuppressWarnings("serial")
@Entity
@Table(name = "sys_dict")
@Getter
@Setter
@ApiModel(value = "字典")
public class Dict extends BaseEntity {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @ApiModelProperty(value = "主键")
    private Long id;

    @ApiModelProperty(value = "字典类型", required = true)
    private String dictType;

    @ApiModelProperty(value = "字典类型名称", required = true)
    private String dictName;

    @ApiModelProperty(value = "字典名称", required = true)
    private String label;
    @ApiModelProperty(value = "字典值", required = true)
    private String value;

    @ApiModelProperty(value = "项排序", required = true)
    private Integer sort;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "创建时间", required = true)
    private Date createTime;

    /**
     * 删除的状态
     */
    @DeleteField
    @ApiModelProperty(value = "删除字体:默认:0 删除1")
    private String delFlag = "0";

    public Dict(String dictType,String dictName, String label, String value) {
        this.dictType = dictType;
        this.label = label;
        this.value = value;
        this.dictName=dictName;
    }

    public Dict(String dictType,String dictName, String label, String value,  int sort) {
        this.dictType = dictType;
        this.label = label;
        this.value = value;
        this.sort = sort;
        this.dictName=dictName;
    }

    public Dict() {

    }

}
